      subroutine hcmbst(xlpt,xinit,a,sr)
c------------------------------------------------                       hsu01090
c     xlpt => loop time of the filter in secs                           hsu01100
c     xinit  => initialization ? 0 = yes ; 1 = no                       hsu01110
c     a      => array                                                   hsu01120
c-------------------------------------------------                      hsu01130
      dimension a(1005)                                                 hsu01150
      pi=3.141592654
      w=2.*pi/xlpt                                                      hsu01170
c----------------- tuning filter coefficient                            hsu01180
c     n => loop length                                                  hsu01190
      n=aint(xlpt*sr)                                                   hsu01200
c     pc => delay required from the allpass filter                      hsu01210
      pc=sr*xlpt-n                                                      hsu01220
c     cc => coefficient of the allpass filter                           hsu01230
      cc=sin((w/sr-w/sr*pc)/2.)/sin((w/sr+w/sr*pc)/2.)                  hsu01240
c---------------------------------------------------------------        hsu01250
      a(1)=10.+n                                                        hsu01260
      if (xinit) 2,1,2                                                  hsu01270
1     le=a(1)                                                           hsu01280
      do 10 l=11,le                                                     hsu01290
      a(l)=0.                                                           hsu01300
10    continue                                                          hsu01310
      a(2)=xlpt                                                         hsu01320
c--------- a(3) =>                                                      hsu01330
      a(3)=0.                                                           hsu01340
c--------- a(4) =>                                                      hsu01350
      a(4)=0.                                                           hsu01360
c--------- a(5) => delay line pointer                                   hsu01370
      a(5)=10.                                                          hsu01380
c--------- a(6) =>                                                      hsu01390
      a(6)=0.                                                           hsu01400
c--------- a(7) => input delay                                          hsu01410
      a(7)=0.                                                           hsu01420
c--------- a(8) => output delay                                         hsu01430
      a(8)=0.                                                           hsu01440
c--------- a(9) => allpass filter coefficient                           hsu01450
      a(9)=cc                                                           hsu01460
      a(1) = a(1) - 1
      a(5) = a(5) - 1
c.......adjustments for C
2     return                                                            hsu01470
      end                                                               hsu01480
